#include<stdio.h>
typedef struct 
{
    unsigned char TIM_Start_Stop : 1;//起始位，占1位
    unsigned char TIM_Overflow : 1;
    unsigned char TIM_Div : 4;
    unsigned char Tim_Stat : 2;
}TimReg_t;

int main(void)
{
    TimReg_t TimeReg;
    unsigned char *pt;
    TimeReg.TIM_Start_Stop = 0b1;
    TimeReg.TIM_Overflow = 0b0;
    TimeReg.TIM_Div = 20;
    TimeReg.Tim_Stat = 0b01;   //0b01010001
    printf("TIM_Start_Stop is %#x\n",TimeReg.TIM_Start_Stop);
    printf("TIM_Overflow is %#x\n",TimeReg.TIM_Overflow);
    printf("TIM_Div is %#x\n",TimeReg.TIM_Div);
    printf("Tim_Stat is %#x\n",TimeReg.Tim_Stat);
    pt = (unsigned char *)&TimeReg;
    printf("The data of struct storage is %#x", *pt);
    return 0;
}